//
//  SectionHeaderView.m
//  VTravel
//
//  Created by lanouhn on 16/8/2.
//  Copyright © 2016年 xiaoYu. All rights reserved.
//

#import "SectionHeaderView.h"

@implementation SectionHeaderView


- (instancetype)initWithTitle:(NSString *)title{
    if (self = [super init]) {
        self.frame = CGRectMake(0, 0, kScreenWidth, 30);
        
        UILabel *lable = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, kScreenWidth - 80, 30)];
        lable.text = title;
        lable.font = [UIFont systemFontOfSize:15];
        lable.backgroundColor = [UIColor clearColor];
        [self addSubview:lable];
        
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        [button setTitle:@"更多>>" forState:(UIControlStateNormal)];
        [button setTitleColor:[UIColor grayColor] forState:(UIControlStateNormal)];
        button.titleLabel.font = [UIFont systemFontOfSize:15];
        button.backgroundColor = [UIColor clearColor];
        button.frame = CGRectMake(kScreenWidth - 70, 0, 70, 30);
        [button addTarget:self action:@selector(buttonClicked) forControlEvents:(UIControlEventTouchUpInside)];
        [self addSubview:button];
        
    }
    return self;
}
#pragma mark - 更多button点击跳转事件
- (void)buttonClicked{
    if (self.mornBtnClicked) {
        self.mornBtnClicked();
    }
}

@end
